using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NextLevelTips : MonoBehaviour
{
    [SerializeField] GameObject tipsUI;

    private void Start() {
        tipsUI.SetActive(false);
    }

    private void OnEnable() {
        EventHandler.AddListener(Events.NextLevel, CallNextLevel);
    }

    private void OnDisable() {
        EventHandler.RemoveListener(Events.NextLevel);
    }

    private void CallNextLevel()
    {
        TimeManager.Instance.GetTimer(2f, ResumeGame);

        tipsUI.SetActive(true);
    }

    private void ResumeGame()
    {
        tipsUI.SetActive(false);

        EventHandler.Dispatch(Events.ResetGame);
    }
}
